package demo1;

interface Shape{

    int A = 1;
    int B = 2;
    int C = 3;

    void draw();
}

class Rect implements Shape{

    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

class Flower implements Shape{
    @Override
    public void draw() {
        System.out.println("花");
    }
}

public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Shape shape1 = new Rect();
        Shape shape2 = new Flower();
        drawMap(shape1);
        drawMap(shape2);
        Shape[] shapes = {new Rect(),new Flower(),new Rect(),new Flower()};

        for (Shape shape :shapes)
        {
            shape.draw();
        }
    }
}
